#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def rgb_string_to_hex(rgb_string):
    """
    将RGB格式的颜色代码字符串转换为十六进制颜色代码
    参数：
        rgb_string: RGB格式的颜色代码字符串，例如"rgb(255,0,0)"
    返回值：
        十六进制颜色代码（例如：'#ff0000'代表红色）
    """
    # 从字符串中提取数字部分
    rgb = rgb_string.strip().split("(")[1].split(
        ")")[0].split(",")
    # 将字符串数字转换为整数格式
    red, green, blue = [int(x) for x in rgb]
    # 将RGB颜色转换为十六进制颜色
    hex_color = '#{:02x}{:02x}{:02x}'.format(
        red, green, blue)
    return hex_color.lower()


# Windows Terminal的ANSI颜色名称
colors = [
    "black", "red", "green", "yellow", "blue", "purple",
    "cyan", "white"
]
brights = ["bright" + s.capitalize() for s in colors]
all_colors = colors + brights

# 把GNOME Terminal的palette数组直接粘贴过来
gnome_palette = eval(input())

# 转换为Windows Terminal的配置文件
assert len(all_colors) == len(gnome_palette)
print()
for i in range(len(all_colors)):
    print('"{}": "{}",'.format(
        all_colors[i], rgb_string_to_hex(gnome_palette[i])))

# vscode终端的颜色名称
colors = [
    "black", "red", "green", "yellow", "blue", "magenta",
    "cyan", "white"
]
ansi_colors = [
    "terminal.ansi" + s.capitalize() for s in colors
]
ansi_brights = [
    "terminal.ansiBright" + s.capitalize() for s in colors
]
all_colors = ansi_colors + ansi_brights

# 转换为VSCode Terminal的配置文件
assert len(all_colors) == len(gnome_palette)
print()
for i in range(len(all_colors)):
    print('"{}": "{}",'.format(
        all_colors[i], rgb_string_to_hex(gnome_palette[i])))
